package com.example.gateway.conf;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;

// @Configuration
public class GateWayConfig {

  @Bean
  public RouteLocator routeLocatorConfig(RouteLocatorBuilder builder) {
    return builder
        .routes()
        .route("2employee", r -> r.path("/employee").uri("http://localhost:8082/"))
        .route("2consumer", r -> r.path("/consumer/**").uri("http://localhost:8081/"))
        .build();
  }
}
